package com.pengtu.gsj.entity.jsbz;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.pengtu.gsj.entity.app.Attachment;
import com.pengtu.gsj.entity.base.IdEntity;

/**
 * 技术保障 防护性养护管理 路面材料循环利用
 * RoadCycle
 * 
 * 2017年6月15日 上午10:31:53
 * @author heyong
 *
 */
@Entity
@Table(name = "T_JS_ROADCYCLE")
public class RoadCycle extends IdEntity {
	
	private static final long serialVersionUID = 1L;
	
	private String projectName;         //项目名称                
	private String projectNumber;       //项目编号
	private String roadCode;      		//路段代码
	private String roadName;            //道路名称
	private String projectPoint;        //项目概括
	private String projectLocation;     //工程位置
	private String testYear;            //年份 
	private Double asphalMaterial;      //沥青砼材料回收量
	private Double asphalLocalUse;		//沥青砼材料就地利用量
	private Double asphalCycleUse;		//沥青砼材料循环利用量
	private Double cementMaterial;      //水泥砼材料回收量
	private Double cementLocalUse;		//水泥砼材料就地利用量
	private Double cementCycleUse;      //水泥砼材料循环利用量
	private Double asphalRate;			//沥青砼材料利用率
	private Double cementRate;			//水泥砼材料利用率
	private Double wholeRate;			//综合利用率
	
	private Double useNumber;			//总利用量
	private String isUseCase;			//是否有利用方案（0是 1，否）
	private String remark;				//备注
	
	private Integer bulletinNumber;     //检测文件数
	private List<Attachment> attachments;
	
	/*
	 * 显式声明空参构造函数，否则因为有一个有参构造函数，无法自动生成无参构造函数
	 */	
	public RoadCycle() {
	}
	
	/*
	 * 根据实际业务需求使用hql进行查询，返回结果所需的构造器
	 */
	public RoadCycle(String testYear, Double asphalMaterial, Double asphalLocalUse, Double asphalCycleUse, Double cementMaterial, Double cementLocalUse, Double cementCycleUse, Double asphalRate, Double cementRate,  Double wholeRate) {
		this.testYear = testYear;
		this.asphalMaterial = asphalMaterial;
		this.asphalLocalUse = asphalLocalUse;
		this.asphalCycleUse = asphalCycleUse;
		this.cementMaterial = cementMaterial;
		this.cementLocalUse = cementLocalUse;
		this.cementCycleUse = cementCycleUse;
		this.asphalRate = asphalRate;
		this.cementRate = cementRate;
		this.wholeRate = wholeRate;
	}

	/*
	 * 根据实际业务需求使用hql进行查询，返回结果所需的构造器
	 */
	public RoadCycle(String projectName,String isUseCase, Double useNumber) {
		this.projectName = projectName;
		this.isUseCase = isUseCase;
		this.useNumber = useNumber;
	}

	public RoadCycle(String testYear) {
		this.testYear = testYear;
	}
	@Column(name = "PROJECTNAME")
	public String getProjectName() {
		return projectName;
	}
	@Column(name = "PROJECTNUMBER")
	public String getProjectNumber() {
		return projectNumber;
	}
	@Column(name = "ROADCODE")
	public String getRoadCode() {
		return roadCode;
	}
	@Column(name = "ROADNAME")
	public String getRoadName() {
		return roadName;
	}
	@Column(name = "PROJECTPOINT")
	public String getProjectPoint() {
		return projectPoint;
	}
	@Column(name = "PROJECTLOCATION")
	public String getProjectLocation() {
		return projectLocation;
	}
	@Column(name = "TESTYEAR")
	public String getTestYear() {
		return testYear;
	}
	@Column(name = "ASPHALMATERIAL")
	public Double getAsphalMaterial() {
		return asphalMaterial;
	}
	@Column(name = "ASPHALLOCALUSE")
	public Double getAsphalLocalUse() {
		return asphalLocalUse;
	}
	@Column(name = "ASPHALCYCLEUSE")
	public Double getAsphalCycleUse() {
		return asphalCycleUse;
	}
	@Column(name = "CEMENTMATERIAL")
	public Double getCementMaterial() {
		return cementMaterial;
	}
	@Column(name = "CEMENTLOCALUSE")
	public Double getCementLocalUse() {
		return cementLocalUse;
	}
	@Column(name = "CEMENTCYCLEUSE")
	public Double getCementCycleUse() {
		return cementCycleUse;
	}
	@Column(name = "ASPHALRATE")
	public Double getAsphalRate() {
		return asphalRate;
	}
	@Column(name = "CEMENTRATE")
	public Double getCementRate() {
		return cementRate;
	}
	@Column(name = "WHOLERATE")
	public Double getWholeRate() {
		return wholeRate;
	}
	@Column(name = "USENUMBER")
	public Double getUseNumber() {
		return useNumber;
	}
	@Column(name = "ISUSECASE")
	public String getIsUseCase() {
		return isUseCase;
	}
	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}
	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}
	public void setProjectNumber(String projectNumber) {
		this.projectNumber = projectNumber;
	}
	public void setRoadCode(String roadCode) {
		this.roadCode = roadCode;
	}
	public void setRoadName(String roadName) {
		this.roadName = roadName;
	}
	public void setProjectPoint(String projectPoint) {
		this.projectPoint = projectPoint;
	}
	public void setProjectLocation(String projectLocation) {
		this.projectLocation = projectLocation;
	}
	public void setTestYear(String testYear) {
		this.testYear = testYear;
	}
	public void setAsphalMaterial(Double asphalMaterial) {
		this.asphalMaterial = asphalMaterial;
	}
	public void setAsphalLocalUse(Double asphalLocalUse) {
		this.asphalLocalUse = asphalLocalUse;
	}
	public void setAsphalCycleUse(Double asphalCycleUse) {
		this.asphalCycleUse = asphalCycleUse;
	}
	public void setCementMaterial(Double cementMaterial) {
		this.cementMaterial = cementMaterial;
	}
	public void setCementLocalUse(Double cementLocalUse) {
		this.cementLocalUse = cementLocalUse;
	}
	public void setCementCycleUse(Double cementCycleUse) {
		this.cementCycleUse = cementCycleUse;
	}
	public void setAsphalRate(Double asphalRate) {
		this.asphalRate = asphalRate;
	}
	public void setCementRate(Double cementRate) {
		this.cementRate = cementRate;
	}
	public void setWholeRate(Double wholeRate) {
		this.wholeRate = wholeRate;
	}
	public void setUseNumber(Double useNumber) {
		this.useNumber = useNumber;
	}
	public void setIsUseCase(String isUseCase) {
		this.isUseCase = isUseCase;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	
	
	@Transient
	public Integer getBulletinNumber() {
		bulletinNumber = attachments.size();
		return bulletinNumber;
	}

	public void setBulletinNumber(Integer bulletinNumber) {
		this.bulletinNumber = bulletinNumber;
	}

	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARTID")
	public List<Attachment> getAttachments() {
		return attachments;
	}

	public void setAttachments(List<Attachment> attachments) {
		this.attachments = attachments;
	}
	
	
	
}
